package com.ruoyi.lession.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.lession.entily.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TitleContentMapper {

    List<TitleContentUtil> select(Long id);

    Integer cnumSum(List<String> listContent);

    @Select("SELECT * FROM tb_report WHERE #{cnum} > minnum AND #{cnum} < maxnum")
    List<Report> reportList(Integer cnum);

    @Select("SELECT l.* FROM tb_report_lesson rc LEFT JOIN tb_lesson l ON rc.id = l.id WHERE rc.rid = #{rid} AND l.status = 1")
    List<Lesson> lessonList(Long rid);

    @Select("SELECT v.* FROM tb_report_video rc LEFT JOIN tb_video v ON rc.vid = v.vid WHERE rc.rid = #{rid}")
    List<Video> videoList(Long rid);

    List<TitleContent> selectList(QueryWrapper<TitleContent> queryWrapper);
}
